package org.xiaoleng.cdm.service.impl;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.xiaoleng.cdm.convertors.JobConfigConvertor;
import org.xiaoleng.cdm.entity.ro.JobConfigurationRO;
import org.xiaoleng.cdm.entity.dto.DataJob;
import org.xiaoleng.cdm.service.JobService;

@Service
@Slf4j
public class JobServiceImpl implements JobService {

    @Override
    public String create(JobConfigurationRO configuration) {
        DataJob dataJob = new DataJob(JobConfigConvertor.convert(configuration));
        dataJob.start();
        return dataJob.getId();
    }
}
